3.111 \(\int \frac{\cos (c+d x)}{a+i a \tan (c+d x)} \, dx\)

Optimal. Leaf size=47 \[ \frac{2 \sin (c+d x)}{3 a d}+\frac{i \cos (c+d x)}{3 d (a+i a \tan (c+d x))} \]

[Out]

(2*Sin[c + d*x])/(3*a*d) + ((I/3)*Cos[c + d*x])/(d*(a + I*a*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0370954, antiderivative size = 47, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.091, Rules used = {3502, 2637} \[ \frac{2 \sin (c+d x)}{3 a d}+\frac{i \cos (c+d x)}{3 d (a+i a \tan (c+d x))} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]/(a + I*a*Tan[c + d*x]),x]

[Out]

(2*Sin[c + d*x])/(3*a*d) + ((I/3)*Cos[c + d*x])/(d*(a + I*a*Tan[c + d*x]))

Rule 3502

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*(d
*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^n)/(b*f*(m + 2*n)), x] + Dist[Simplify[m + n]/(a*(m + 2*n)), Int[(d*Sec[
e + f*x])^m*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0] && NeQ[m + 2*n, 0] && IntegersQ[2*m, 2*n]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{\cos (c+d x)}{a+i a \tan (c+d x)} \, dx &=\frac{i \cos (c+d x)}{3 d (a+i a \tan (c+d x))}+\frac{2 \int \cos (c+d x) \, dx}{3 a}\\ &=\frac{2 \sin (c+d x)}{3 a d}+\frac{i \cos (c+d x)}{3 d (a+i a \tan (c+d x))}\\ \end{align*}

Mathematica [A]  time = 0.117212, size = 50, normalized size = 1.06 \[ -\frac{\sec (c+d x) (2 i \sin (2 (c+d x))+\cos (2 (c+d x))-3)}{6 a d (\tan (c+d x)-i)} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]/(a + I*a*Tan[c + d*x]),x]

[Out]

-(Sec[c + d*x]*(-3 + Cos[2*(c + d*x)] + (2*I)*Sin[2*(c + d*x)]))/(6*a*d*(-I + Tan[c + d*x]))

________________________________________________________________________________________

Maple [A]  time = 0.078, size = 75, normalized size = 1.6 \begin{align*} 2\,{\frac{1}{ad} \left ( -1/3\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{-3}+{\frac{i/2}{ \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{2}}}+3/4\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{-1}+1/4\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) +i \right ) ^{-1} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)/(a+I*a*tan(d*x+c)),x)

[Out]

2/d/a*(-1/3/(tan(1/2*d*x+1/2*c)-I)^3+1/2*I/(tan(1/2*d*x+1/2*c)-I)^2+3/4/(tan(1/2*d*x+1/2*c)-I)+1/4/(tan(1/2*d*
x+1/2*c)+I))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 1.96835, size = 122, normalized size = 2.6 \begin{align*} \frac{{\left (-3 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 6 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} e^{\left (-3 i \, d x - 3 i \, c\right )}}{12 \, a d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/12*(-3*I*e^(4*I*d*x + 4*I*c) + 6*I*e^(2*I*d*x + 2*I*c) + I)*e^(-3*I*d*x - 3*I*c)/(a*d)

________________________________________________________________________________________

Sympy [A]  time = 0.486814, size = 128, normalized size = 2.72 \begin{align*} \begin{cases} \frac{\left (- 24 i a^{2} d^{2} e^{5 i c} e^{i d x} + 48 i a^{2} d^{2} e^{3 i c} e^{- i d x} + 8 i a^{2} d^{2} e^{i c} e^{- 3 i d x}\right ) e^{- 4 i c}}{96 a^{3} d^{3}} & \text{for}\: 96 a^{3} d^{3} e^{4 i c} \neq 0 \\\frac{x \left (e^{4 i c} + 2 e^{2 i c} + 1\right ) e^{- 3 i c}}{4 a} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c)),x)

[Out]

Piecewise(((-24*I*a**2*d**2*exp(5*I*c)*exp(I*d*x) + 48*I*a**2*d**2*exp(3*I*c)*exp(-I*d*x) + 8*I*a**2*d**2*exp(
I*c)*exp(-3*I*d*x))*exp(-4*I*c)/(96*a**3*d**3), Ne(96*a**3*d**3*exp(4*I*c), 0)), (x*(exp(4*I*c) + 2*exp(2*I*c)
 + 1)*exp(-3*I*c)/(4*a), True))

________________________________________________________________________________________

Giac [A]  time = 1.1344, size = 90, normalized size = 1.91 \begin{align*} \frac{\frac{3}{a{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + i\right )}} + \frac{9 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 12 i \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 7}{a{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - i\right )}^{3}}}{6 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

1/6*(3/(a*(tan(1/2*d*x + 1/2*c) + I)) + (9*tan(1/2*d*x + 1/2*c)^2 - 12*I*tan(1/2*d*x + 1/2*c) - 7)/(a*(tan(1/2
*d*x + 1/2*c) - I)^3))/d